<template>
  <el-sub-menu v-if="menu.children?.length > 0" :index="ind + ''">
    <template #title>{{ menu.name }}</template>
    <NuxtLink v-for="(item, index) in menu.children" :to="'/articleType/' + ind + '-' + index">
      <el-menu-item :index="ind + '-' + index">{{ item.name }}</el-menu-item></NuxtLink
    >
  </el-sub-menu>
  <NuxtLink v-else :to="ind == 0 ? '/' : '/articleType/' + ind"
    ><el-menu-item :index="ind + ''">{{ menu.name }}</el-menu-item></NuxtLink
  >
</template>
<script setup lang="ts">
defineProps({
  menu: {
    type: Object as PropType<any>,
    required: true,
  },
  ind: {
    type: Number,
    required: true,
  },
});
</script>
